import battery from '@system.battery'

export default function() {
  return new Promise(resolve => {
    try {
      battery.getStatus({
        success: resolve,
        fail() {
          resolve({})
        }
      })
    } catch(e) {
      resolve({})
      console.error(e)
    }
  })
}
